package cn.edu.scau.cmi.yangzemin.client;

import java.util.Scanner;

import cn.edu.scau.cmi.yangzemin.abstractFactory.AbstractFactory;
import cn.edu.scau.cmi.yangzemin.abstractFactory.AonongFactory;
import cn.edu.scau.cmi.yangzemin.abstractFactory.TianbangFactory;
import cn.edu.scau.cmi.yangzemin.abstractFactory.WensFactory;
import cn.edu.scau.cmi.yangzemin.abstractFactory.ClientConsumeBrand;

public class AbstractFactoryClient {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		AbstractFactory abstractFactory = null;
		
		System.out.print("Please input your favority facyory: ");
		
		Scanner scanner = new Scanner(System.in);
		String typeOfBrand =scanner.next();
		
		switch(typeOfBrand) {
		case "Wens":  abstractFactory = new WensFactory();break;
		case "Aonong":  abstractFactory = new AonongFactory();break;
		case "Tianbang":  abstractFactory = new TianbangFactory();break;
		}
	
		System.out.print("please input your favority food: ");
		
		scanner =new Scanner(System.in);
		String typeOfFood =scanner.next();
		
		ClientConsumeBrand clientConsumeBrand =null;
		switch(typeOfFood) {
		case "Beef": clientConsumeBrand = abstractFactory.createBeef();break;
		case "Pork": clientConsumeBrand = abstractFactory.createPork();break;
		case "Chicken": clientConsumeBrand= abstractFactory.createChicken();break;
		}
		
		if(clientConsumeBrand!=null) {
			clientConsumeBrand.display();
		}
		
	}

}
